import pageTools from '@/components/pageTools'
import UploadImg from '@/components/UploadImg'
import ImageHolder from '@/components/ImageHolder'
import store from '@/store'
import Lang from './Lang'
import ScreenFull from './ScreenFull'
export default {
  install: function(Vue) {
    Vue.component('pageTools', pageTools)
    Vue.component('UploadImg', UploadImg)
    Vue.component('ImageHolder', ImageHolder)
    Vue.component('Lang', Lang)
    Vue.component('ScreenFull', ScreenFull)
    // Vue.prototype.fn = () => { alert('fn1') }
    Vue.directive('allow', {
      inserted(el, binding) {
        const point = store.state.user.userInfo.roles.points
        const flag = point.includes(binding.value)
        if (!flag) {
          el.parentNode.removeChild(el)
        }
      }
    })
  }

}
